import request from '@/utils/request'

export function getList(page, limit, visitorQuery) {
  return request({
    url: `/dormitory/visitor/list/${page}/${limit}`,
    method: 'post',
    data: visitorQuery
  })
}

export function getVisitor(id) {
  return request({
    url: `/dormitory/visitor/getVisitor/${id}`,
    method: 'get'
  })
}

export function save(visitor) {
  return request({
    url: `/dormitory/visitor/save`,
    method: 'post',
    data: visitor
  })
}

export function update(visitor) {
  return request({
    url: `/dormitory/visitor/update`,
    method: 'post',
    data: visitor
  })
}

export function remove(id) {
  return request({
    url: `/dormitory/visitor/remove/${id}`,
    method: 'delete'
  })
}

export function buildingList() {
  return request({
    url: `/dormitory/building/buildingList`,
    method: 'get'
  })
}
